home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / Exec / lists.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  2KB  |  75 lines

  1. #ifndef EXEC_LISTS_H
  2. #define EXEC_LISTS_H 1
  3. /*
  4. ** lists.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/02/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for lists.h
  17. */
  18. #ifndef ListPtr
  19. #define ListPtr ADDRESS
  20. #endif
  21. #ifndef MinListPtr
  22. #define MinListPtr ADDRESS
  23. #endif
  24. /*
  25. ** End of StructPointer defines for lists.h
  26. */
  27.       
  28. #ifndef EXEC_NODES_H
  29. #include <exec/nodes.h>
  30. #endif /* EXEC_NODES_H */
  31.  
  32.  
  33. /*
  34.  *  Full featured list header.
  35.  */
  36. STRUCT _List  
  37.    NodePtr  lh_Head 
  38.    NodePtr  lh_Tail 
  39.    NodePtr  lh_TailPred 
  40.    BYTE    lh_Type 
  41.    BYTE    l_pad 
  42. END STRUCT   /* SHORTINT aligned */
  43.  
  44. /*
  45.  * Minimal List Header - no type checking
  46.  */
  47. STRUCT MinList  
  48.    MinNodePtr  mlh_Head 
  49.    MinNodePtr  mlh_Tail 
  50.    MinNodePtr  mlh_TailPred 
  51. END STRUCT   /* longword aligned */
  52.  
  53.  
  54. /*
  55.  *  Check for the presence of any nodes on the given list.  These
  56.  *  macros are even safe to use on lists that are modified by other
  57.  *  tasks.  However  if something is simultaneously changing the
  58.  *  list,  the result of the test is unpredictable.
  59.  *
  60.  *  Unless you first arbitrated for ownership of the list,  you can't
  61.  *  _depend_ on the contents of the list.  Nodes might have been added
  62.  *  or removed during or after the macro executes.
  63.  *
  64.  *      if( IsListEmpty(list) )     printf("List is empty\n") 
  65.  */
  66. /*
  67. #define IsListEmpty(x) \
  68.     ( ((x)->lh_TailPred) == (STRUCT Node *)(x) )
  69.  
  70. #define IsMsgPortEmpty(x) \
  71.     ( ((x)->mp_MsgList.lh_TailPred) == (STRUCT Node *)(&(x)->mp_MsgList) )
  72. */
  73.  
  74. #endif  /* EXEC_LISTS_H */
  75.